#ifndef BINARY_SEMAPHORE_H
#define BINARY_SEMAPHORE_H

typedef int SemaphoreId;

/**
 * Semaphores pi.
 */

namespace BinarySemaphore
{
	/**
	 * Create semaphore, semId will be filled
	 * with created semaphore id.
	 */
	int Create(SemaphoreId& semId);

	/**
	 * Initialiaze semaphore with value 1.
	 */
	int Init(SemaphoreId semId);

	/**
	 * Deallocate semaphore with semId.
	 */
	int Destroy(SemaphoreId semId);

	/**
	 * Increment semaphore.
	 */
	int Increment(SemaphoreId semId);

	/**
	 * Decrement semaphore.
	 */
	int Decrement(SemaphoreId semId);
};

#endif // BINARY_SEMAPHORE_H
